<?php
function liste_theme_select($theme = '')
{
	global $setting, $lang;
	
	$form = '<select name="theme">';
	if($setting['theme'] == '') $form .= '<option value="" selected="selected">'. $lang['Theme_par_defaut'] .' *</option>';
	else $form .= '<option value="'. $setting['theme'] .'" selected="selected">'. $setting['theme'] .' *</option>';
	$form .= '<option value="">'. $lang['Theme_par_defaut'] .'</option>';
	
	$handle = opendir('../theme/');
	while (false !== ($f = readdir($handle)))
	{
	    if ($f != "." && $f != ".." && $f != "CVS" && $f != "index.html" && !ereg("[.]", $f))
	    {
	        if (is_file('../theme/' . $f . '/design.css')) $form .= '<option value="' . $f . '">' . $f . '</option>';
	    } 
	} 
	closedir($handle);
	$form .= '</select>';
	return $form;
   
}

function GetUser($id)
{
    global $db;
    if($id == '') return false;
    else
    {
        $User = $db->sql_query("SELECT id, nom, prenom, identifiant, email FROM immo_user WHERE id = '". $id ."'",'ARRAY');
        if($db->nb_resultat != 1) return false;
        else return $User;
    }
}
?>